package com.zzt.zt_hilt.Module

import com.zzt.zt_hilt.entity.Code
import com.zzt.zt_hilt.inter.Work
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.scopes.ActivityScoped

/**
 * @author: zeting
 * @date: 2022/8/29
 *
 */

//定义一个模块
@Module
@InstallIn(ActivityComponent::class)  //模块安装在Activity组件中
abstract class WorkMdule {
    @ActivityScoped
    //使用@Binds修饰一个函数，用来向Hilt提供实例
    @Binds
    abstract fun bindWork(code: Code): Work
}